{extend name="layout/layout" /}

{block name="pagecss"}
<link href="__STATIC__/admin/pages/css/store.css" rel="stylesheet" type="text/css" />
{/block}

{block name="content"}
<div class="row">
	<div class="col-xs-12">
		<div class="box box-success">
			<div class="box-header with-border">
				<h3 class="box-title">添加门店</h3>
				<div class="box-tools">
					<!--<button class="btn bg-navy btn-sm" data-toggle="tooltip" title="" data-original-title="Back" onclick="history.go(-1);">
                        <i class="fa fa-reply"></i> 返回
                    </button>-->
				</div>
			</div>
			<div class="box-body">
				<div id="modal_new_role" class="form-horizontal form">
					<div class="form-body">
						<div class="form-group">
							<div class="col-md-6">
								<input type="hidden" value="" name="id">
							</div>
						</div>
						<div class="form-group">
							<lable class="col-md-2 control-label"><span class="required">* </span>门店名称：</lable>
							<div class="col-md-6">
								<input type="text" class="form-control input-xlarge" value="" name="input_name" maxlength="40" placeholder="请填写门店名称">
							</div>
						</div>
						<div class="form-group">
							<lable class="col-md-2 control-label"><span class="required">*</span>门店地址：</lable>
							<div class="col-md-6">
								<div class="row selectCon">
									<div class="col-md-4">
										<select id="province" name="province" class="form-control ipt areaLists"></select>
									</div>
									<div class="col-md-4">
										<select id="city" name="city" class="form-control ipt areaLists" ></select>
									</div>
									<div class="col-md-4">
										<select id="district" name="district" class="form-control ipt areaLists"></select>
									</div>
								</div>
								<br />
								<div class="add-more " style="margin-top: 0">
									<input type="text" id="address" value="" class="form-control input-large margin-bottom" name="input_address" placeholder="请输入定位地址"><span style="color: red">(注意：此处必须是百度地图可标记的地址，否则会导致小程序首页无法获取定位，无法获取首页数据)</span>
									<input id="addtxt" type="hidden" />
									<input type="text" id="add-text1" value="" class="form-control input-large" name="addressGeo">
									<div style="width:100%;height:300px;" id="map_container"></div>
								</div>
							</div>
						</div>
						<div class="form-group">
							<lable class="col-md-2 control-label"><span class="required">*</span>详细地址：</lable>
							<div class="col-md-6">
								<input class="form-control input-large margin-bottom" name="detailed_address" placeholder="详细地址" /><span>(详细地址，比如门店号，***室等)</span>
							</div>
						</div>
						<form id="tenant_form" action="">
							<!-- 用$('#modal_new_role [name="openWeek"]:checked')取值有极小的概率取不到值，先暂时用form	 -->
							<div class="form-group">
								<lable class="col-md-2 control-label"><span class="required">*</span>营业时间：</lable>
								<div class="col-md-6">
									<div class="btn-group data pro_type">
										{foreach name="week" item="vo" }
										<label class="btn btn-default checkbox-inline margin-bottom" ><input type="checkbox" value="{$key}" name="openWeek" style='position: relative !important; padding: 0;margin: 0;'>{$vo}</label>
										{/foreach}
									</div>

									<div class="datatime form-group" style="margin-top: 15px">
										<div class="col-md-4 datatimebox">
											<input class="form-control input-min" type="text" value="" onClick="WdatePicker({dateFmt:'HH:mm'})" readonly="readonly" name="input_openTime">
										</div>
										<div class="col-md-1"> ~ </div>
										<div class="col-md-4 datatimebox">
											<input class="form-control input-min" type="text" name="input_closeTime" value="" onClick="WdatePicker({dateFmt:'HH:mm'})" readonly="readonly">
										</div>
									</div>
								</div>
							</div>
						</form>
						<div class="form-group">
							<lable class="col-md-2 control-label"><span class="required">* </span>联系电话：</lable>
							<div class="col-md-6">
								<input type="text" class="form-control input-medium" value="" name="input_phone" maxlength="40" placeholder="请输入联系电话">
							</div>
						</div>

						<div class="form-group">
							<lable class="col-md-2 control-label"><span class="required">* </span>联系人姓名：</lable>
							<div class="col-md-6">
								<input type="text" class="form-control input-medium" value="" name="contact_name" maxlength="40" placeholder="请输入联系人姓名">
							</div>
						</div>

						<div class="form-group">
							<lable class="col-md-2 control-label">
								<span class="required"> * </span>门店图片：</lable>
							<div class="col-md-9">
								<p class="form-control-static">请上传750*560分辨率的图片</p>
								<div class="upPicCon">
									<div class="storeimg">
										<form id="storeImg">
											<input type="hidden" name="tagImg" value="">
											<div class="uploaderCon" data-toggle="modal" data-target="#uploaderBox">
												<span class="icon0">+</span>
												<small class="color9">上传图片</small>
											</div>
										</form>
									</div>
								</div>
							</div>
						</div>

						<hr />

						<div class="form-actions">
							<div class="row">
								<div class="col-md-12">
									<div class="form-group">
										<label class="col-md-3 control-label"></label>
										<div class="col-md-9">
											<button type="button" id="modal_sure_new" class="btn btn-primary">
												保存 <i class="fa fa-floppy-o"></i>
											</button>
											<button type="button" id="btn_cancle" class="btn btn-default" onclick="history.go(-1);">
												返回 <i class="fa fa-mail-forward"></i>
											</button>
											<span class="help-block "></span>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<!-- 图片弹框 -->
<div class="modal fade" id="uploaderBox" data-backdrop="static" data-keyboard="false">
	<div class="modal-dialog" style="width:700px; height: 520px;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
				<h4 class="modal-title">图片</h4>
			</div>
			<div class="modal-body">
				<div class="form-horizontal">
					<button class="btn btn-primary" id="localUp">在本地中上传</button>
				</div>
				<div class="tab-content">
					<div class="" id="already">
						<form id="image_form" action="">
							<table class="table" id="pic_table">

							</table>
						</form>
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" id="" class="btn default close-check" data-dismiss="modal">确定</button>
			</div>
		</div>
	</div>
</div>

{/block}

{block name="pagescript"}
<script src="__STATIC__/plugins/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="https://api.map.baidu.com/api?v=2.0&ak=07E2669c3b77a0793274952ba61cd8b8&s=1" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/Area.js" type="text/javascript"></script>
<script>
    var token_url = "{:url('admin/Image/token')}";   //获取七牛token地址
    var index_url = "{:url('admin/store/index')}";  //数据列表页地址
    var tenantrecharge_url = "{:url('admin/Tenant/index')}"   //商户充值页面
    var add_url = "{:url('admin/store/addPost')}";  //增加数据提交地址
    var edit_url = "{:url('admin/store/editPost')}";  //编辑数据提交地址
    var record_url = "{:url('admin/Image/record')}";   //图片上传总表记录
    var del_img_url = "{:url('admin/Image/delete')}";   ////图片上传总表删除地址

    var layer_img = "{:url('admin/image/getList')}";  //图片组件

    var imgcount = 0;  //记录已选图片数量
</script>
<script src="__STATIC__/admin/js/qiniu/plupload.full.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniu.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/custom.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/qiniu/qiniuConfig.js" type="text/javascript"></script>
<script src="__STATIC__/admin/pages/js/store.js" type="text/javascript"></script>
{/block}